/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$(function($){
    $.fn.listicon = function(){
        $(this).children('a').each(function(){
            var needtext = false;
            var buttonicon = [];
            var pIcon = $(this).attr('pIcon')?$(this).attr('pIcon'):'';
            var sIcon = $(this).attr('sIcon')?$(this).attr('sIcon'):'';
            var nText = $(this).attr('needText')?$(this).attr('needText'):"false";
            if((sIcon == '' && pIcon =='') || nText == "true")
                needtext = true;
            if(pIcon != '')
                buttonicon['primary'] = pIcon;
            if(sIcon != '')
                buttonicon['secondary'] = sIcon;
            $(this).button({
                icons: buttonicon,
                text: needtext
            });
        });
    };
});

